import Vue from 'vue'
import Router from 'vue-router'
import Personal from './personal'

Vue.use(Router)

let RouteList = [
  {
    path: '/',
    component: resolve => require(['@/views/layout/App.vue'], resolve),
    meta: {
      title: '首页',
      keepAlive: false,
    },
    children: [
      {
        path: '/',
        name: 'Dashboard',
        meta: {
          title: '首页',
          keepAlive: true
        },
        component: resolve => require(['@/views/home/Index.vue'], resolve),
      },
      {
        path: '/part_list',
        name: 'PartList',
        meta: {
          title: '备件管理',
          keepAlive: false
        },
        component: resolve => require(['@/views/part/PartList.vue'], resolve),
      },
      {
        path: '/part_out',
        name: 'PartOut',
        meta: {
          title: '备件出库',
          keepAlive: false
        },
        component: resolve => require(['@/views/part/PartOut.vue'], resolve),
      },
      {
        path: '/part_add',
        name: 'PartAdd',
        meta: {
          title: '添加备件',
          keepAlive: false
        },
        component: resolve => require(['@/views/part/PartAdd.vue'], resolve),
      },
      {
        path: '/dclient/list',
        name: 'UserList',
        meta: {
          title: '用户列表',
          keepAlive: true
        },
        component: resolve => require(['@/views/userManage/UserList.vue'], resolve),
      },
      {
        path: '/dclient/add',
        name: 'userAdd',
        meta: {
          title: '新增客户',
          keepAlive: true
        },
        component: resolve => require(['@/views/userManage/userAdd.vue'], resolve),
      },
      {
        path: '/dclient/update',
        name: 'userUpdate',
        meta: {
          title: '新增客户',
          keepAlive: true
        },
        component: resolve => require(['@/views/userManage/userUpdate.vue'], resolve),
      },
      {
        path: '/category_manage',
        name: 'CategoryManage',
        meta: {
          title: '分类列表',
          keepAlive: true
        },
        component: resolve => require(['@/views/categoryManage/Index.vue'], resolve),
      },
      {
        path: '/user_manage',
        name: 'UserManage',
        meta: {
          title: '用户列表',
          keepAlive: true
        },
        component: resolve => require(['@/views/permissionManage/user/Index.vue'], resolve),
      },
      
      {
        path: '/role_manage',
        name: 'RoleManage',
        meta: {
          title: '角色列表',
          keepAlive: true
        },
        component: resolve => require(['@/views/permissionManage/role/Role.vue'], resolve), 
      },
      // {
      //   path: '/permission_list',
      //   name: 'PermissionList',
      //   meta: {
      //     title: '权限列表',
      //     keepAlive: true
      //   },
      //   component: resolve => require(['@/views/permissionManage/permission/Index.vue'], resolve),
      // },


      // for test
      {
        path: '/dMaintenance',
        name: 'dMaintenance',
        meta: {
          title: '维修任务查询',
          keepAlive: true
        },
        component: resolve => require(['@/views/dMaintenance/list.vue'], resolve),
      },
      {
        path: '/icon_manage',
        name: 'IconManager',
        meta: {
          title: '图标管理器',
          keepAlive: true
        },
        component: resolve => require(['@/views/icon/ElementIcon.vue'], resolve),
      },
      {
        path: '/service_list',
        name: 'ServiceList',
        meta: {
          title: '报修列表',
          keepAlive: true
        },
        component: resolve => require(['@/views/service/ServiceList.vue'], resolve),
      },
      {
        path: '/service_add',
        name: 'ServiceAdd',
        meta: {
          title: '新增报修',
          keepAlive: true
        },
        component: resolve => require(['@/views/service/ServiceAdd.vue'], resolve),
      },
      {
        path: '/service_sure',
        name: 'ServiceSure',
        meta: {
          title: '报修确认',
          keepAlive: true
        },
        component: resolve => require(['@/views/service/ClientSure.vue'], resolve),
      },
      {
        path: '/service_alter',
        name: 'ServiceAlter',
        meta: {
          title: '报修记录修改',
          keepAlive: true
        },
        component: resolve => require(['@/views/service/ServiceAlter.vue'], resolve),
      },
      {
        path:'/supervision/findClientList',
        name:'findClientList',
        meta:{
          title:'顾客信息查询',
          keepAlive:true
        },
        component:resolve => require(['@/views/supervision/client_list.vue'],resolve),
      },
      {
        path:'/supervision/findDMaintenanceList',
        name:'findDMaintenanceList',
        meta:{
          title:'维修信息查询',
          keepAlive:true
        },
        component:resolve => require(['@/views/supervision/dmaintenance_list.vue'],resolve),
      },
      {
        path:'/payoff/findPayoffList',
        name:'findPayoffList',
        meta:{
          title:'结算信息查询',
          keepAlive:true
        },
        component:resolve => require(['@/views/supervision/payoff_list.vue'],resolve),
      },


      {  path:'/part/partList',
         name:'partList',
        meta:{
         title:'库存信息查询',
          keepAlive:true
},
component:resolve => require(['@/views/supervision/part_list.vue'],resolve),
},




      //个人中心，可能有修改密码，头像修改等路由
      Personal.index,
    ]
  },
  {
    path: '/login',
    name: 'Login',
    meta: {
      title: '后台登录',
      keepAlive: false
    },
    components: {
      blank: resolve => require(['@/views/login/Login.vue'], resolve),
    }
  },

]

export default new Router({routes: RouteList})


